<%--
  Created by IntelliJ IDEA.
  User: PC
  Date: 2024/12/14 014
  Time: 16:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
    <head>
        <title>UserTest.jsp</title>
    </head>
    <body>
        欢迎访问UserTest.jsp页面！<br/><hr/>

        <%-- 前端使用EL表达式取值，接收的优先级：request > session > context --%>
        ${id}<br/>
        ${name}<br/>
        <fmt:formatDate value="${birthday}" pattern="yyyy-MM-dd"/> <br/>
        <c:if test="${gender == 1}">男</c:if>
        <c:if test="${gender == 2}">女</c:if><br/><hr/>

        <%-- 使用EL表达式取requestScope中的值 --%>
        ${requestScope.id}<br/>
        ${requestScope.name}<br/>
        ${requestScope.birthday}<br/>
        <c:if test="${requestScope.gender == 1}">男</c:if>
        <c:if test="${requestScope.gender == 2}">女</c:if><br/><hr/>

        <%-- 使用EL表达式取sessionScope中的值 --%>
        ${sessionScope.id}<br/>
        ${sessionScope.name}<br/>
        ${sessionScope.birthday}<br/>
        <c:if test="${sessionScope.gender == 1}">男</c:if>
        <c:if test="${sessionScope.gender == 2}">女</c:if><br/>
    </body>
</html>
